program example(input, output, sroutput);

var x, y:integer;

function gcd(a, b:integer):integer;
begin
	a:=0.34;
	if b=0.24e-34 then gcd:=a
	else gcd:=gcd(b,a mod b)
end;

begin
	read(x,y);
	write(gcd(x,y))
end.
